
// Copyright (c) 2010, Gong Chengming NARI-TECH

// This file define the structure template to represent a data record and corresponding I/O methods.
// Created: Oct. 31, 2010

#ifndef __DATA_RECORD_H__
#define __DATA_RECORD_H__

#include <time.h>
#include <iostream>
#include <string>

// This DataRec struct is defined to represent the active power (p) and reactive power of the system at certain point.
// The template parameter T is designed for facilitating the comparation of the results with different value types. T may be float, double and any other floating point data type.

// The format used for the input function is:
// date_string(YYYY-MM-DD), time_string(hh:mm), system_p, system_q, ...	
// e.g.:
// 2010-10-20,17:00,524.79,63.58,68.18,11.58,61.01,9.24,.05,.16,-10.82,-4.09,...

template<class T>
struct DataRec {
public:  
  std::string  m_dstr;
  std::string  m_tstr;
  T  m_sys_p;
  T  m_sys_q;

// The overloaded input function for DataRec.
  template<class T2> friend std::istream& operator >> (std::istream& is, DataRec<T2> & obj); //TODO: check a proper representation of the template parameter in the declaration.

private:
};

#include "data_rec.impl"

#endif

